buddy strings solution in c